import React from "react";
// 
class FormCom extends React.Component<any, any>{
    state = {
        val: '',
        sel: '3'
    }
    handleChange = (e: any) => {
        console.log(e.target.value)
        this.setState({ val: e.target.value })
    }
    handleChange2 = (e: any) => {
        this.setState({ sel: e.target.value })
    }
    render(): React.ReactNode {
        return (
            <fieldset>
                <legend>表单</legend>
                <input type="text" value={this.state.val} onChange={this.handleChange} />
                <select value={this.state.sel} onChange={this.handleChange2}>
                    <option value="1">香蕉</option>
                    <option value="2">苹果</option>
                    <option value="3">桃子</option>
                </select>
            </fieldset>
        )
    }
}

export default FormCom